#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>

int main()
{
    int fd = open("mypipe",O_WRONLY);
    if(fd == -1)
    {
        perror("open");
        exit(EXIT_FAILURE);
    }
    const char*message = "i am process A\n";
    ssize_t byte_written = write(fd,message,strlen(message));
    if(byte_written == -1)
    {
        perror("write");
        close(fd);
        exit(EXIT_FAILURE);
    }
    close(fd);
    return 0;
}
